<?php

add_action('init','of_options');

if (!function_exists('of_options')) {
function of_options(){

//Theme Shortname
$shortname = "redox";


//Populate the options array
global $tt_options;
$tt_options = get_option('of_options');


//Access the WordPress Pages via an Array
$tt_pages = array();
$tt_pages_obj = get_pages('sort_column=post_parent,menu_order');    
foreach ($tt_pages_obj as $tt_page) {
$tt_pages[$tt_page->ID] = $tt_page->post_name; }
$tt_pages_tmp = array_unshift($tt_pages, "Select a page:"); 


//Access the WordPress Categories via an Array
$tt_categories = array();  
$tt_categories_obj = get_categories('hide_empty=0');
foreach ($tt_categories_obj as $tt_cat) {
$tt_categories[$tt_cat->cat_ID] = $tt_cat->cat_name;}
$categories_tmp = array_unshift($tt_categories, "Select a category:");

/*-----------------------------------------------------------------------------------*/
/* Create The Custom Site Options Panel
/*-----------------------------------------------------------------------------------*/
$options = array(); // do not delete this line - sky will fall




$options[] = array( "name" => __('General Options','redox_localize'),
			"type" => "heading");

$options[] = array( "name" => __('Enable Header Image','redox_localize'),
			"desc" => __('Use a header image instead of text title. Use uploader below.','redox_localize'),
			"id" => $shortname."_use_header_image",
			"std" => "false",
			"type" => "checkbox");

$options[] = array( "name" => __('Header Image','redox_localize'),
			"desc" => __('Header Image. Must enable above option first.','redox_localize'),
			"id" => $shortname."_header_img",
			"std" => "",
			"type" => "upload");


$options[] = array( "name" => __('Background Image','redox_localize'),
			"desc" => __('Background Image.','redox_localize'),
			"id" => $shortname."_background_img",
			"std" => "",
			"type" => "upload");

$options[] = array( "name" => __('Use Infinite Scroll Trigger Pagination','redox_localize'),
			"desc" => __('Use Infinite Scroll Pagination (Load New Posts via Click Trigger.)','redox_localize'),
			"id" => $shortname."_use_infinite_scroll",
			"std" => "false",
			"type" => "checkbox");

$options[] = array( "name" => __('Favicon','redox_localize'),
			"desc" => __('Upload a 16px x 16px image that will represent your website\'s favicon.<br /><br /><em>To ensure cross-browser compatibility, we recommend converting the favicon into .ico format before uploading. (<a href="http://www.favicon.cc/">www.favicon.cc</a>)</em>','redox_localize'),
			"id" => $shortname."_favicon",
			"std" => "",
			"type" => "upload");

$options[] = array( "name" => __('Google Tracking Code','redox_localize'),
			"desc" => __('Paste Google Analytics (or other) tracking code here. You may also use any javascript here.','redox_localize'),
			"id" => $shortname."_google_analytics",
			"std" => "",
			"type" => "textarea");
			
$options[] = array( "name" => __('Custom CSS','redox_localize'),
			"desc" => __('Custom CSS Code','redox_localize'),
			"id" => $shortname."_custom_css",
			"std" => "",
			"type" => "textarea");


$options[] = array( "name" => __('Colors','redox_localize'),
			"type" => "heading");


$options[] = array( "name" => __('Background','redox_localize'),
			"desc" => __('Background Color','redox_localize'),
			"id" => $shortname."_background_color",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Header','redox_localize'),
			"desc" => __('Header Background Color','redox_localize'),
			"id" => $shortname."_header_background_color",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Header Accent','redox_localize'),
			"desc" => __('Header Text And Accent Color','redox_localize'),
			"id" => $shortname."_header_accent_color",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Sidebar','redox_localize'),
			"desc" => __('Sidebar Background Color','redox_localize'),
			"id" => $shortname."_sidebar_background_color",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Sidebar Accent','redox_localize'),
			"desc" => __('Sidebar Text And Accent Color','redox_localize'),
			"id" => $shortname."_sidebar_accent_color",
			"std" => "",
			"type" => "color");

$options[] = array( "name" => __('Sidebar Accent Alt','redox_localize'),
			"desc" => __('Sidebar Alt Text Color. Used for Twitter Tweet Bubbles','redox_localize'),
			"id" => $shortname."_sidebar_accent_alt_color",
			"std" => "",
			"type" => "color");

$options[] = array( "name" => __('Page Dropdown Border','redox_localize'),
			"desc" => __('Border Color For Expansion Pages','redox_localize'),
			"id" => $shortname."_page_dropdown_border",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Post Alt Background','redox_localize'),
			"desc" => __('Background Color For Quote, Link, Chat, Aside Post Types','redox_localize'),
			"id" => $shortname."_post_alt_background",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Post Alt Text','redox_localize'),
			"desc" => __('Text Color For Quote, Link, Chat, Aside Post Types','redox_localize'),
			"id" => $shortname."_post_alt_text",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Galley Background','redox_localize'),
			"desc" => __('Background Color For Gallery Post Types','redox_localize'),
			"id" => $shortname."_gallery_background_color",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Post Headings','redox_localize'),
			"desc" => __('Post Headings','redox_localize'),
			"id" => $shortname."_post_headings",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Highlight Text','redox_localize'),
			"desc" => __('Highlight Text','redox_localize'),
			"id" => $shortname."_highlight_text",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Highlight Background','redox_localize'),
			"desc" => __('Highlight Background','redox_localize'),
			"id" => $shortname."_highlight_background",
			"std" => "",
			"type" => "color");	


$options[] = array( "name" => __('Element Background','redox_localize'),
			"desc" => __('Background for posts, pagination, comments.','redox_localize'),
			"id" => $shortname."_element_background",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Element Border','redox_localize'),
			"desc" => __('Border for posts, pagination, comments.','redox_localize'),
			"id" => $shortname."_element_border",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Element Text','redox_localize'),
			"desc" => __('Body text for posts, pagination, comments.','redox_localize'),
			"id" => $shortname."_element_text",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Link Text','redox_localize'),
			"desc" => __('Link Text','redox_localize'),
			"id" => $shortname."_link_text",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Link Text Underline','redox_localize'),
			"desc" => __('Link Text Underline','redox_localize'),
			"id" => $shortname."_link_text_underline",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Tag Background','redox_localize'),
			"desc" => __('Background Color for Tags','redox_localize'),
			"id" => $shortname."_tag_background",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Tag Text','redox_localize'),
			"desc" => __('Text Color for Tags','redox_localize'),
			"id" => $shortname."_tag_text",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Tag Alt Background','redox_localize'),
			"desc" => __('Hover Background Color for Tags','redox_localize'),
			"id" => $shortname."_tag_alt_background",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Tag Alt Text','redox_localize'),
			"desc" => __('Hover Text Color for Tags','redox_localize'),
			"id" => $shortname."_tag_alt_text",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('Block Quote Border','redox_localize'),
			"desc" => __('Block Quote Border','redox_localize'),
			"id" => $shortname."_blockquote_border",
			"std" => "",
			"type" => "color");	

$options[] = array( "name" => __('General Accent Background','redox_localize'),
			"desc" => __('General Accent Background','redox_localize'),
			"id" => $shortname."_general_accent_background",
			"std" => "",
			"type" => "color");

$options[] = array( "name" => __('General Accent Text','redox_localize'),
			"desc" => __('General Accent Text','redox_localize'),
			"id" => $shortname."_general_accent_text",
			"std" => "",
			"type" => "color");

$options[] = array( "name" => __('Meta Hover Text','redox_localize'),
			"desc" => __('Meta Hover Text Color.','redox_localize'),
			"id" => $shortname."_meta_hover",
			"std" => "",
			"type" => "color");

$options[] = array( "name" => __('Post Meta Information','redox_localize'),
			"type" => "heading");	

$options[] = array( "name" => __('Post Meta Author','redox_localize'),
			"desc" => __('Display the author in the post meta section.','redox_localize'),
			"id" => $shortname."_meta_author",
			"std" => "true",
			"type" => "checkbox");

$options[] = array( "name" => __('Post Meta Date','redox_localize'),
			"desc" => __('Display the date in the post meta section.','redox_localize'),
			"id" => $shortname."_meta_date",
			"std" => "true",
			"type" => "checkbox");

$options[] = array( "name" => __('Post Meta Comments','redox_localize'),
			"desc" => __('Display the comment count in the post meta section','redox_localize'),
			"id" => $shortname."_meta_commentcount",
			"std" => "true",
			"type" => "checkbox");

$options[] = array( "name" => __('Post Meta Share','redox_localize'),
			"desc" => __('Display the share buttons in the post meta section','redox_localize'),
			"id" => $shortname."_meta_share",
			"std" => "true",
			"type" => "checkbox");
					
$options[] = array( "name" => __('Widget Sidebar','redox_localize'),
			"type" => "heading");	

$options[] = array( "name" => __('Thumbnail for Sidebar Activator in Menu','redox_localize'),
			"desc" => __('Thumbnail in the menu that activates the sidebar on click.','redox_localize'),
			"id" => $shortname."_sidebar_img",
			"std" => "",
			"type" => "upload");
		

$options[] = array( "name" => __('Widgets','redox_localize'),
			"desc" => "",
			"id" => $shortname."_widgets_callout",
			"std" => "Sidebar Widgets May Be Added via the Appearance > Widgets Option From The Left Sidebar.",
			"type" => "info");
			


update_option('of_template',$options); 					  
update_option('of_themename',isset($themename));   
update_option('of_shortname',$shortname);

}
}
?>